<?php get_header();?>
<script type="text/javascript" src="<?php bloginfo('template_url');?>/mails/js/mycontact.js"></script>
	<style>
		.contact_error
		{
			display:none;
		}
		.contact_error_show
		{
			display:block;
			color:red;
			font-weight:bold;
			float:left;
			margin-left:5px;
		}
		.content-box-1 img
		{
			margin:0 !important;	
		}
		.content-box-1
		{
			margin-top:15px;	
		}
		#content.page-hotels-detail .content-box-1 .bg-internet-booking ul li
		{
			margin-bottom:5px !important;
}
	</style>
<body>
<div id="topbg"></div>
<div id="container">
	<div id="header">
    	<?php include TEMPLATEPATH.'/controllers/banner/controller-banner.php';?>
        <?php require_once TEMPLATEPATH.'/views/menu/view-menu.php';?>
    </div>
    
    <div id="mid">
    	<div id="box-content">
            <!-- begin breadcrumb -->
            <?php require_once TEMPLATEPATH.'/views/breadcrumb/view-breadcrumb.php';?>
            <!-- end #breadcrumb -->
            
            <div id="content" class="page-hotels-detail">
            	<div class="content-box-1">
                <?
                    if(have_posts())
                    {
                        the_post();
                        
                        $postID = get_the_ID();
                        $title  = get_the_title();
                        $alt = db_vietnamese_slug($title);
                        $address = get_post_meta($postID,$wpdb->prefix.'address',true);
                        $rating  = get_post_meta($postID,$wpdb->prefix.'rating',true);
                        $price = get_post_meta($postID,$wpdb->prefix.'price',true);
                        $thumbnail = db_get_post_meta($postID,$wpdb->prefix.'thumbnail');    
                    }
                ?>
                    <h1 class="label-content-box-1-top"><? echo $title;?></h1>
                    <?                    
                    if($thumbnail)
                        echo '<img src="'.$thumbnail.'" alt="'.$alt.'" />';
                    if($address)
                        echo '<p><strong>Address:</strong>  '.$address.'</p>';
                    if($rating)
                    {
                         echo '<p><strong>Ratings:</strong><span class="ratings">';
                        for($j=1;$j<=$rating;$j++)
                        {
                            echo '<img src="'.get_bloginfo("template_url").'/images/star.png" alt="" style="width:14px; height:14px; margin:0; padding:0;">';  
                        }       
                        echo '</span></p>';
                    }
                    ?>
                    <strong>Description</strong> :  
                    <? the_content();?> 
                    
                    <div class="btnbooking">
                    	<a href="<?php bloginfo('home');?>/booking?booked=hotel&hotelID=<?php echo $postID;?>"><img alt="" src="<?php bloginfo('template_url');?>/images/bookingbtn_03.png" style="width: 138px; height: 32px;">
                    </a></div>
                    <div class="clear"></div>
                  
                    <?php
                    ## Bang Gia
					//$list_price = db_select_all_data("hotel_price");
					$hotelID = $postID;
					$list_price = db_select_all_data_by_hotelID("hotel_price",$hotelID);
					//print_r($list_price); 
					if($list_price)
					{
					?>
                    <table width="97%" align="center" cellspacing="0" cellpadding="0">
                   		<tbody><tr class="tieude">
                        	<td>Type Room</td>
                            <td>Max</td>
                            <td>Total of rooms </td>
                            <td>Room empty</td>
                            <td>Rate for 1 night(s)</td>
                        </tr>
                        <?php						
							foreach ($list_price as $value) 
							{
							?>
							<tr>	                        	
	                            <td class="cot1"> <?php echo $value->typeroom;?></td>
								<td> <?php echo $value->max;?></td>
								<td> <?php echo $value->totalofroom;?></td>
								<td> <?php echo $value->roomempty;?></td>
								<td class="cot5"> <?php echo $value->ratefornight;?> USD</td>
	                        </tr>
							<?php 	
							}						
						?>
                        
                   </tbody>
                   </table>
                    <?php }?>
                   <!-- Price Table -->
                   
                   <?php //include TEMPLATEPATH.'/IOs/price-table.php';?>
                   
                    <div class="div10"></div>
                    <?php
                    $internet = get_post_meta($postID, $wpdb->prefix.'internet_booking',true);
                    if($internet)
                    { 
                    ?>
	                   <div class="internet-booking"><span class="line-color-red"></span><h6>Internet booking</h6></div>
	                   <div class="bg-internet-booking">
	                   <?php
	                   echo $internet; 
	                   ?>
	                   	<!-- 
	                   	<ul>
	                     	<li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                        <li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                        <li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                        <li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                        <li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                        <li>Check-in time: 	  from 14:00 until later. Sooner subject to room availability.</li>
	                     </ul>
	                     -->
	                     
	                   </div>
                      <div class="div10"></div>
                    <?php
                    } 
                    ?>  
                    <div class="news">
                    <?php
                    $Features = get_post_meta($postID, $wpdb->prefix.'hotel_feature',true);
                    if($Features)
                    { 
                    ?>
                	<div class="newtour">Hotel Features</div>
                    <div class="linetour"></div>
                    <div class="clear"></div>
                    <div class="bg-internet-booking">
                    <!-- 
                    <ul class="feather">
                     	<li> 24/7 Room Service</li>
                        <li>Baggage Store</li>
                        <li>Disabled Facilities/Rooms</li>
                        <li>Elevator</li>
                        <li>Executive Floor</li>
                        <li>Express Check-In/Out.</li>
                        <li> 24/7 Room Service</li>
                        <li>Baggage Store</li>
                        <li>Disabled Facilities/Rooms</li>
                        <li>Elevator</li>
                        <li>Executive Floor</li>
                        <li>Express Check-In/Out.</li>                       
                     </ul>
                     -->
                     <?php 
                     $Features = str_ireplace("<ul>", "<ul class='feather'>", $Features);
                     echo $Features;
                     ?>
                    </div>
                    
                    <?php
                    }

                    $Policies = get_post_meta($postID, $wpdb->prefix.'hotel_policies',true);
                    if($Policies)
                    { 
                    ?>                  
                    <div class="div10"></div>
                     <div class="newtour">Hotel Policies</div>
                    <div class="linetour"></div>
                    <div class="clear"></div>
                    <div class="bg-internet-booking">
                    <!-- 
                    <ul class="police">
                     	<li> 24/7 Room Service</li>
                        <li>Baggage Store</li>
                        <li>Disabled Facilities/Rooms</li>
                        <li>Elevator</li>
                        <li>Executive Floor</li>
                        <li>Express Check-In/Out.</li>
                        <li> 24/7 Room Service</li>
                        <li>Baggage Store</li>
                        <li>Disabled Facilities/Rooms</li>
                        <li>Elevator</li>
                        <li>Executive Floor</li>
                        <li>Express Check-In/Out.</li>                       
                     </ul>
                     -->
                     <?php
                     $Policies = str_ireplace("<ul>", "<ul class='police'>", $Policies);
                     echo $Policies; 
                     ?>
                    </div>
                    
                    <?php
                    } 
                    ?>
                	<div class="clear"></div>
                	<div class="div10"></div>
                    <div class="btnbooking"><a href="<?php bloginfo('home');?>/booking?booked=hotel&hotelID=<?php echo $postID;?>"><img alt="" src="<?php bloginfo('template_url');?>/images/bookingbtn_03.png" style="width: 138px; height: 32px;"></a></div>
                    <div class="clear"></div>
                    
                    <?
                    $photo_hotels = db_get_post_meta_multi($postID,$wpdb->prefix.'thumbnail2');
                    if($photo_hotels)
                    {                    
                    ?>
                    <div class="newtour">Photos of this hotel</div>
                    <div class="linetour"></div>
                    <div class="clear"></div>                    
                    <div class="photo-hotels">
                    	<ul>
                            <?
                            foreach ($photo_hotels as $value)
                            {
                            ?>
                            <li>
                            	<div class="bg-photo-hotels"><a href="" rel="<?php echo $value;?>" class="preview" title="<?php echo get_the_title($postID);?>">
                                <img onmouseout="myHint.hide()" onmouseover="myHint.show('<?php echo $images;?>')" src="<? echo $value;?>" alt="<? echo $title;?>" />
                                </a></div>
                            </li>    
                            <?    
                            }
                            ?>                        	                            
                        </ul>
                        <div class="clear"></div>
                    </div>
                    
                    <style>
                    #preview
                    {
                    	position:absolute;
                    	border:1px solid silver;
                    	background:#ffffff;
                    	padding:5px;
                    	display:none;
                    	color:#000000;
                    	max-width:350px;
                    	max-height:250px;
                    	text-align:center;	
                    	z-index:30;
                    }                                        
                    </style>
                    
                    <script type="text/javascript" src="<?php bloginfo('template_url');?>/js/main.js"></script>
                    
                    
                    <?
                    }
                    ?>
                    <div class="div10"></div>
                    <div class="lefttag"></div>
                    <div class="righttag">
                        <?php the_tags(' ','  ',' ');?>
                    </div>
                	<div class="clear"></div>
                    <div class="div10"></div>
                    <ul class="social">
                    	<?php include TEMPLATEPATH.'/views/social/social1.php';?>
                    </ul>
					<div class="clear"></div>
                    
                    <?
                    $type_comment = 'hotel';
                    $type = $type_comment;
                    include TEMPLATEPATH.'/comments/view-comment-form.php'
                    ?>
                
                   <? include TEMPLATEPATH.'/views/hotel/view-similar-single-hotel.php'?>
            
                </div>
                </div>
                <?php include TEMPLATEPATH.'/views/testimonial/view-home-testimonial.php';?>
            </div>
            
        </div>
        
        <?php get_sidebar();?>
    </div>
    
    <?php //include TEMPLATEPATH.'/views/testimonial/view-home-testimonial.php';?>
    <?php get_footer('tour');?>
